@extends('default.layouts.personalPublic')
@section('title', '简历管理')
@section('headcss')
    @parent
    <link rel="stylesheet" href="{{asset('/default/css/personal/resumeBackup.css')}}">
@endsection
@section('rightcon')
    <div class="right">

        <!--简历设置-->
        <div class="jright">
            <div class="content">
                <div class="jobtitle">
                    <div class="tithead">
                        <h2>简历管理</h2>
                    </div>

                    <div class="default">
                        <div class="one">
                            <span>默认简历</span>
                        </div>
                        <div class="two">
                            <span class="title">
                               @if($resume->language == 'en')
                                    <a href="{{url('personal/english/resume_mange?resume_id='.$resume->id)}}">{{str_limit($resume->resume_name,20)}}</a>
                                @elseif($resume->language == 'cn')
                                    <a href="{{url('personal/resume_mange?resume_id='.$resume->id)}}">{{str_limit($resume->resume_name,20)}}</a>
                                @endif

                            </span>
                            <p class="perfect"><span>
                                        完善度：
                                </span>
                                <span class="shell"><i style="width:{{$resume->percentage}}"></i></span>
                                <span class="completion">{{$resume->percentage}}</span>
                            </p>
                        </div>
                        <div class="three">
                            <span><strong>{{$resume->resumeSendCount}}</strong>投递职位</span>
                            <span><strong>{{$resume->browseResumeCount}}</strong>被浏览</span>
                            <span><strong>{{$resume->interviewCount}}</strong>面试通知</span>
                        </div>
                        <div class="four">
                            <p>修改时间：</p>
                            <p>{{$resume->updatetime}}</p>
                        </div>
                        <div class="five">
                            <ul>
                                @if($resume->language == 'en')
                                    <li><a href="{{url('personal/english/resume_mange?resume_id='.$resume->id)}}"
                                           target="_blank">修改</a></li>
                                    <li><a href="{{url('resume_'.idEncryption($resume->id).'.html')}}"
                                           target="_blank">预览</a></li>
                                    <li><a href="{{url('personal/warmtips?resume_id='.$resume->id)}}">刷新</a></li>
                                    <li><a href="{{url('personal/privacy?resume_id='.$resume->id)}}">隐私</a></li>
                                @elseif($resume->language == 'cn')
                                    <li><a href="{{url('personal/resume_mange?resume_id='.$resume->id)}}"
                                           target="_blank">修改</a></li>
                                    <li><a href="{{url('resume_'.idEncryption($resume->id).'.html')}}"
                                           target="_blank">预览</a></li>
                                    <li><a href="{{url('personal/warmtips?resume_id='.$resume->id)}}">刷新</a></li>
                                    <li><a href="{{url('personal/privacy?resume_id='.$resume->id)}}">隐私</a></li>
                                @endif

                            </ul>
                        </div>
                    </div>
                    <div class="create"><p>您还可以创建<strong>{{$countResume}}</strong>份简历!<a
                                    onclick="createResume('{{$countResume}}')">创建中文版</a><a
                                    onclick="createResumenglish('{{$countResume}}')">创建英文版</a></p></div>
                    @if(count($moreResume) > 0)
                        <div class="more">
                            @foreach($moreResume as $v)
                                <div class="rlist">
                                    <ul>
                                        <li class="p1">
                                            @if($v->language == 'en')
                                                <a href="{{url('personal/english/resume_mange?resume_id='.$v->id)}}">{{str_limit($v->resume_name,20)}}</a>
                                                <sapn style="margin-left: 20px;">{{$v->language}}</sapn>
                                            @elseif($v->language == 'cn')
                                                <a href="{{url('personal/resume_mange?resume_id='.$v->id)}}">{{str_limit($v->resume_name,20)}}</a>
                                                <sapn style="margin-left: 20px;">{{$v->language}}</sapn>
                                            @endif

                                        </li>
                                        <li class="p2">
                                            @if($v->language == 'en')
                                                Degree :{{$v->percentage}}
                                            @elseif($v->language == 'cn')
                                                完善度：{{$v->percentage}}
                                            @endif
                                        </li>
                                        <li class="p3">
                                            @if($v->language == 'en')
                                                Modify time :{{$v->updatetime}}
                                            @elseif($v->language == 'cn')
                                                修改时间：{{$v->updatetime}}
                                            @endif
                                        </li>
                                        <li class="p4">
                                            @if($v->language == 'en')
                                                Delivery Post：{{$v->resumeSendCount}}
                                            @elseif($v->language == 'cn')
                                                投递职位：{{$v->resumeSendCount}}
                                            @endif

                                        </li>
                                        <li class="p5">
                                            @if($v->language == 'en')
                                                <span><a href="{{url('personal/english/resume_mange?resume_id='.$v->id)}}"
                                                         target="_blank">Modify</a></span>
                                                <span><a href="{{url('resume_'.idEncryption($v->id).'.html')}}"
                                                         target="_blank">Preview</a></span>
                                                <span><a href="{{url('personal/privacy?resume_id='.$v->id)}}">Privacy</a></span>
                                                <span><a href="{{url('personal/set_default/'.$v->id)}}">Default</a></span>
                                            @elseif($v->language == 'cn')
                                                <span><a href="{{url('personal/resume_mange?resume_id='.$v->id)}}"
                                                         target="_blank">修改</a></span>
                                                <span><a href="{{url('resume_'.idEncryption($v->id).'.html')}}"
                                                         target="_blank">预览</a></span>
                                                <span><a href="{{url('personal/privacy?resume_id='.$v->id)}}">隐私</a></span>
                                                <span><a href="{{url('personal/set_default/'.$v->id)}}">设为默认</a></span>
                                            @endif

                                        </li>
                                        <li class="p6">
                                            @if($v->language == 'en')
                                                <span><a onclick="del('{{$v->id}}')">Delete</a></span>
                                            @elseif($v->language == 'cn')
                                                <span><a onclick="del('{{$v->id}}')">删除</a></span>
                                            @endif
                                        </li>
                                    </ul>
                                </div>
                            @endforeach
                        </div>
                    @endif

                </div>
            </div>
        </div>

    </div>
@endsection
@section('footerjs')
    @parent
    <script>
        $(function(){
            $('#resume_backup').addClass('on');
            @if(session('success'))
                layer.ready(function(){
                layer.msg("{{session('success')}}", {time: 1500});
            });
            @endif
        });
        /**
         * 删除简历
         * param resume_id
         */
        function del(resume_id){
            layer.confirm('您确定要删除这个简历吗？', {
                btn: ['确定', '取消'] //按钮
            }, function(){
                $.post("{{url('personal/del_resume/')}}/" + resume_id, {'_token': "{{csrf_token()}}"}, function(data){
                    if(data.status == 0){
                        layer.msg(data.msg, {icon: 6});
                        location = '/personal/resume_backup';
                    }else{
                        layer.msg(data.msg, {icon: 5});
                    }
                });
            });
        }
        /**
         * 创建新简历
         * param countNumbei
         */
        function createResume(countNumber){
            if(countNumber <= 0){
                layer.msg('简历达到5份上限', {time: 1500, icon: 3});
            }else{
                location = '/personal/my_resume';
            }
        }
        /**
         * 创建英文新简历
         * param countNumbei
         */
        function createResumenglish(countNumber){
            if(countNumber <= 0){
                layer.msg('简历达到5份上限', {time: 1500, icon: 3});
            }else{
                location = '/personal/english/my_resume';
            }
        }
    </script>
    <script type="text/javascript" src="{{asset('/default/js/personal/privacy.js')}}"></script>
@endsection